#pragma once
#include <iostream>
using namespace std;
#include <string>
#include <mysql_driver.h>
#include <mysql_connection.h>

#include "../utils/log.h"

class Connection
{
public:
    sql::Connection *connect;
    Connection();
    ~Connection();
    void refresh();
    [[nodiscard]] clock_t timeout() const;
private:
    sql::mysql::MySQL_Driver *driver;
    clock_t timeoutTime{};
    std::string error;
    std::string host;
    std::string user;
    std::string passwd;
    std::string db;
};